﻿using System;

using OhioState.AssetManaged;
using OhioState.Math;

namespace OhioState.Graphics.Proxy
{
    /// <summary>
    ///  Simple Sphere Class
    /// </summary>
    [Serializable]
    public class SharedSphere : SharedAsset, IShape
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public SharedSphere()
            : this("")
        {
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">name of sphere</param>
        public SharedSphere(String name)
            : base(name)
        {
        }

        /// <summary>
        /// Bounding sphere
        /// </summary>
        public BoundingSphere BSphere
        {
            get { return boundingSphere; }
        }

        /// <summary>
        /// Accessors: Get Set for radius
        /// </summary>
        public float Radius
        {
            get { return boundingSphere.Radius; }
            set
            {
                boundingSphere.Radius = value;
                FireUpdateChangedEvent(this);

            }
        }
        /// <summary>
        /// Accessors Get Set for Position of sphere
        /// </summary>
        public Vector3 Position
        {
            get { return boundingSphere.Position; }
            set
            {
                boundingSphere.Position = value;
                FireUpdateChangedEvent(this);

            }
        }
        
        #region IShape Members
        
        /// <summary>
        /// Implementation of IShape method ShapeType()
        /// </summary>
        public ShapeType ShapeType
        {
            get { return ShapeType.Ellipsoid; }
        }
        #endregion

        private BoundingSphere boundingSphere = new BoundingSphere();
    }
}
